package com.itboye.ihomebank.util;

import java.util.List;
/**
 * 就是json拼接一下，，
 */
public class JSONUtil {
    public static <T> String fromList(List<T> list) throws Throwable {
        StringBuilder json = new StringBuilder();
        if (list == null || list.size() == 0) {
            return null;
        }
        json.append("[");
        for(int i = 0; i < list.size(); i++) {
            json.append(list.get(i));

            if (i < list.size() - 1) {
                json.append(",");
            }
        }
        json.append("]");
        return json.toString();
    }

}
